package ddemo.dao;

import ddemo.pojo.Interface;

import java.util.List;

public interface InterfaceMapper {
    @Select("SELECT * FROM `interface` WHERE chargerid = #{chargerid}")
    public List<Interface> searchInterface(@Param("chargerid") Integer chargerid);

    @Select("UPDATE INTERFACE SET `usestatus` = #{usestatus},`userid` = #{userid} WHERE id = #{id}")
    public int UpdateStatu(@Param("usestatus") String staus, @Param("id") Integer id,@Param("userid") Integer userid);

    @Select("INSERT INTO `INTERFACE` (chargerid,usestatus,userid) VALUES (#{chargerid},#{usestatus},#{userid})")
    public int addInterface(@Param("chargerid") Integer chargerid,@Param("usestatus") String usestatus,@Param("userid") Integer userid);

    @Select("DELETE FROM `interface` WHERE id = #{id}")
    public int deleteInterface(@Param("id") Integer id);

    @Select("SELECT * from `INTERFACE`")
    public List<Interface> getinterface();

    @Select("SELECT * from `interface` WHERE userid = #{userid}")
    public Interface isChongdian(@Param("userid") Integer userid);

    @Select("UPDATE INTERFACE SET `usestatus` = #{usestatus},`userid` = #{userid} WHERE id = #{id}")
    public int stopUse(@Param("id") Integer id, @Param("usestatus") String usestatus,@Param("userid") Integer userid);

}
